home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 4.0 KB | 156 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Select.cpp
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Hello.hpp"
-
- #ifndef SELECT_H
- #include "Select.h"
- #endif
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- // ----- OS Includes -----
-
- #ifndef FWBARRAY_H
- #include "FWBArray.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h"
- #endif
-
- #ifndef FWSTREAM_H
- #include "FWStream.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__DRAG__)
- #include <Drag.h>
- #endif
-
- //========================================================================================
- // Runtime information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfhello
- #endif
-
- FW_DEFINE_AUTO(CHelloSelection)
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const ODPropertyName kHelloPropText = "Hello:Property:Text";
-
- //========================================================================================
- // CLASS CHelloSelection
- //========================================================================================
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection constructor
- //---------------------------------------------------------------------------------------
-
- CHelloSelection::CHelloSelection(Environment* ev, CHelloContent* content) :
- FW_CSelection(ev, false, false),
- fHelloContent(content)
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection destructor
- //---------------------------------------------------------------------------------------
-
- CHelloSelection::~CHelloSelection()
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection::GetSelectedContent
- //---------------------------------------------------------------------------------------
- // The whole content is always selected
-
- FW_CContent* CHelloSelection::GetSelectedContent(Environment* ev)
- {
- return fHelloContent;
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection::ClearSelection
- //---------------------------------------------------------------------------------------
-
- void CHelloSelection::ClearSelection(Environment* ev)
- {
- fHelloContent->ClearTextData(ev);
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection::CloseSelection
- //---------------------------------------------------------------------------------------
-
- void CHelloSelection::CloseSelection(Environment* ev)
- {
- // Nothing to do
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection::IsEmpty
- //---------------------------------------------------------------------------------------
-
- FW_Boolean CHelloSelection::IsEmpty(Environment* ev) const
- {
- // Is the current string empty?
- return (fHelloContent->GetTextData().GetByteLength() == 0);
- }
-
- //---------------------------------------------------------------------------------------
- // CHelloSelection::SelectAll
- //---------------------------------------------------------------------------------------
-
- void CHelloSelection::SelectAll(Environment* ev)
- {
- // Part's data is always "selected"
- }
-
-
-